package suzf.top.kotlinjava.common.mapper;

import suzf.top.kotlinjava.common.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param
import suzf.top.kotlinjava.service.model.TestUserModel

/**
 *  用户表 Mapper 接口
 *========================
 * Created with IntelliJ IDEA
 * Author: Mr.Su
 * Blog: https://suzf.top/
 * Date: 2019-10-10
 * ========================
 */
interface UserMapper : BaseMapper<User> {

    /**
     *  查询全部
     */
    fun selectAll(): MutableList<User>

    fun selectAll1(): MutableList<TestUserModel>

    /**
     *  根据ID查询单个用户
     */
    fun findOneById(@Param("id") id: Int): User?

    /**
     *  根据用户名查询用户
     */
    fun findOneByUserName(@Param("userName") userName: String): User?

    /**
     *  根据ID删除单个
     */
    fun deleteById(@Param("id") id: Int)
}
